package com.cdream.bank1.seata.controller;


import com.cdream.bank1.seata.service.AccountInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zs
 * @since 2021-08-29
 */
@RestController
@RequestMapping("/seata/account-info")
public class AccountInfoController {
    @Autowired
    AccountInfoService accountInfoService;
    //转账/bank2/transfer
    @GetMapping("/transfer")
    public String transfer(Double amount){
        accountInfoService.updateAccountBalance("1",amount);
        return "bank1"+amount;
    }

}
